serialized.txt

a:24:{s:18:"extra.get_one_user";s:29:"SELECT * FROM user LIMIT 0,1;";s:9:"role.deny";s:78:"DELETE FROM role_permission WHERE role LIKE :role AND action LIKE :permission;";s:11:"role.delete";s:102:"DELETE FROM role_permission where role LIKE :role;
DELETE FROM user_role where role LIKE :role; --stop";s:10:"role.allow";s:71:"INSERT INTO role_permission (role, action)
VALUES (:role, :permission);";s:15:"user.from_email";s:43:"SELECT * FROM user WHERE email LIKE :email;";s:16:"user.from_cookie";s:236:"SELECT u.* FROM `user` u
    JOIN `code` c
        ON c.user_id = u.id
    WHERE 
        c.code LIKE :code
        AND c.expires_at > NOW()
        AND c.is_active = 1
        AND u.is_active = 1
        AND c.type LIKE 'login_cookie';";s:18:"user.code_is_valid";s:194:"SELECT u.email FROM `user` u
    JOIN `code` c
        ON c.user_id = u.id
    WHERE c.code LIKE :code
        AND c.type LIKE :type
        AND c.expires_at > NOW()
        AND c.is_active = 0;";s:17:"user.security_log";s:99:"INSERT INTO security_log(action, email, ip, user_agent)
VALUES (:action, :email, :ip, :user_agent);";s:11:"user.logout";s:145:"UPDATE `code` SET `is_active` = 0, `expires_at` = NOW()
WHERE `type` LIKE 'login_cookie' 
    AND `code` LIKE :code
    AND `user_id` = :user_id;";s:17:"user.get_password";s:56:"SELECT `password` FROM `user` WHERE `email` LIKE :email;";s:13:"user.activate";s:360:"UPDATE `code` as c
    LEFT JOIN `user` as u on u.id = c.user_id
    SET c.is_active = 1,
        c.activated_at = NOW(),
        u.is_active = 1
    
WHERE 
   c.user_id = :user_id
    AND c.is_active = 0
    AND c.activated_at IS NULL
    AND c.code LIKE :code
    AND c.expires_at > NOW()
;
SELECT c.type FROM code as c 
    WHERE c.code LIKE :code
; --stop";s:13:"user.new_code";s:176:"INSERT INTO `code` (code,type,user_id,expires_at,is_active,activated_at)
    VALUES(:code, :type, :user_id, TIMESTAMPADD(SECOND, :expiry, NOW()),
        :is_active, %s
     );";s:13:"user.add_role";s:63:"INSERT INTO user_role (role, user_id)
VALUES (:role, :user_id);";s:28:"user.all_nonrole_permissions";s:68:"SELECT action as name FROM permissions
    WHERE user_id = :user_id;";s:14:"user.all_roles";s:239:"-- gets all roles even if there are no permissions associated with the role
SELECT ur.role as role, rp.action as perm FROM user_role ur
    LEFT OUTER JOIN role_permission rp
        ON rp.role LIKE ur.role
    WHERE ur.user_id = :user_id;";s:18:"user.get_all_roles";s:73:"SELECT ur.role as role FROM user_role ur
    WHERE ur.user_id = :user_id;";s:10:"user.allow";s:73:"INSERT INTO permissions (action, user_id)
    VALUES (:action, :user_id);";s:9:"user.deny";s:82:"DELETE FROM permissions 
    WHERE action LIKE :action
    AND user_id = :user_id;";s:8:"user.can";s:276:"SELECT user_id, action FROM permissions p
    WHERE p.action LIKE :action
        AND p.user_id = :user_id
UNION 
SELECT user_id, action FROM role_permission rp
    JOIN user_role ur
        on ur.role LIKE rp.role
    WHERE action LIKE :action
    AND ur.user_id = :user_id
;";s:14:"user.with_role";s:115:"SELECT * FROM user WHERE user.id IN 
(
    SELECT ur.user_id FROM user_role ur
        WHERE ur.role LIKE :role
)
;";s:13:"user.register";s:67:"INSERT INTO `user` (email, password)
    VALUES(:email, :password);";s:17:"user.new_password";s:306:"UPDATE user u
JOIN code c
    ON c.user_id = u.id
SET u.password = :password_hash,
    c.is_active = 1,
    c.activated_at = NOW()
WHERE 
    c.code LIKE :code 
    AND c.is_active = 0
    AND c.activated_at IS NULL
    AND c.expires_at > NOW()
    AND c.type LIKE 'password_reset'
    AND u.id = :user_id;";s:13:"user.get_logs";s:88:"SELECT * FROM security_log WHERE email LIKE :email ORDER BY created_at DESC LIMIT 0, %s;";s:16:"user.remove_role";s:67:"DELETE FROM user_role WHERE role LIKE :role AND user_id = :user_id;";}